﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Customer_Profile.Admin
{
    public partial class AddCodeType : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ibtnModify_ServerClick(object sender, EventArgs e)
        {
            CodeTypeDao codeTypeDao = new CodeTypeDao();
            int flag = codeTypeDao.Add(txtName.Value.Trim(), txtRemark.Value.Trim(), txtOrderid.Value.Trim(), drpUsed.SelectedValue.ToString().Trim());
            if (flag == 1)
                Comm.ViewMsgGoUrl("CodeManage.aspx", "Success");
            else if (flag == 0)
            {
                Comm.ViewAlertMsg("This Categories is exist");
                return;
            }
            else
            {
                Comm.ViewAlertMsg("Operation Wrong");
            }
        }

        protected void ibtnBack_ServerClick(object sender, EventArgs e)
        {
            Response.Redirect("CodeManage.aspx",false);
        }
    }
}
